#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import requests

url_knowledge = 'https://api.ownthink.com/kg/knowledge'

url = 'https://api.ownthink.com/kg/ambiguous'
params = {'mention':'张伟'}

resp = requests.get(url, params)

a = resp.json()
for e, i in a['data']:
    params = {'entity':e}
    resp = requests.get(url_knowledge, params)
    a = resp.json()
    print(a['data'])


# url = 'https://api.ownthink.com/kg/eav'

# params = {'entity':'苹果', 'attribute':''}
# resp = requests.get(url, params)

# a = resp.json()
# print(a['data'])

# if a['message']=='success':
#     for k, v in a['data'].items():
#         print(k, ':', v)
# else:
#     print('Commision is fail!☠️'*10)
